#!/bin/bash
echo "修复程序依赖..."

# 复制所有必要的 DLL
cp /ucrt64/bin/libjpeg-8.dll ./
cp /ucrt64/bin/libpng16-16.dll ./
cp /ucrt64/bin/libtiff-6.dll ./
cp /ucrt64/bin/libpcre2-16-0.dll ./
cp /ucrt64/bin/libwinpthread-1.dll ./
cp /ucrt64/bin/libstdc++-6.dll ./
cp /ucrt64/bin/libgcc_s_seh-1.dll ./

# 创建兼容性符号链接
ln -sf libjpeg-8.dll libjpeg.dll 2>/dev/null
ln -sf libpng16-16.dll libpng16.dll 2>/dev/null
ln -sf libtiff-6.dll libtiff-5.dll 2>/dev/null
ln -sf libpcre2-16-0.dll libpcre2-16.dll 2>/dev/null

echo "修复完成！当前目录的 DLL："
ls -la *.dll | grep -E "jpeg|png|tiff|pcre"
